﻿using System;
namespace Producers.Doc.Xtee.Riik.Ee.Producer.Doc {
    
    
    public class SMLXSizeType : global::Xtee.Schema.XsdToken {
        
        public const string VÄIKE = "small";
        
        public const string KESKMINE = "medium";
        
        public const string VÄGASUUR = "large";
        
        public const string EXTRALARGE = "extra large";
        
        public SMLXSizeType(string value) : 
                base(value) {
            this.Pattern = @"(1|2|3)";
            this.PikkusSuuremVõrdneKui = 5;
            this.Validate();
            string annot = null;
            if (Value == "small") {
                annot = "Väike";
            }
            if (Value == "medium") {
                annot = "Keskmine";
            }
            if (Value == "large") {
                annot = "Väga suur";
            }
            if (Value == "extra large") {
                annot = "extra large";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public SMLXSizeType() : 
                base(string.Empty) {
        }
        
        public static bool TryParse(string value, out global::Producers.Doc.Xtee.Riik.Ee.Producer.Doc.SMLXSizeType result) {
            try {
                result = new global::Producers.Doc.Xtee.Riik.Ee.Producer.Doc.SMLXSizeType(value);
                return true;
            }
            catch (System.Exception ex) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator String (SMLXSizeType value) {
            return value.Value;
        }
        
        public static implicit operator SMLXSizeType (string value) {
            return new SMLXSizeType(value);
        }
    }
}
